home *** CD-ROM | disk | FTP | other *** search
- property pCharCode, pDownFlag, pOrigRect, pOrigReg, pBigFlashRect, pSoundChannel, pSpr, ancestor, pFrameToRecreate
- global gBarTopManager, debug, gCharChildren, gGameLevel, gMachineSpeed, gBounceInProgress
-
- on removeCharacterTraces me
- pCharCode = VOID
- ancestor = VOID
- end
-
- on beginSprite me
- global gArbusSoundChan
- pSoundChannel = gArbusSoundChan
- pSpr = sprite(me.spriteNum)
- pSpr.quality = #high
- setFlashRectsInk(me)
- removeCharacterTraces(me)
- hide(me)
- setFlashAttributes(me)
- fixEventTriggers(me)
- hide(me)
- if pSpr.frame = 1 then
- pSpr.frame = 2
- end if
- end
-
- on setFlashRectsInk me
- global gShowFlashRects
- if gShowFlashRects = 1 then
- pSpr.ink = 0
- else
- pSpr.ink = 36
- end if
- end
-
- on mouseDown
- pDownFlag = 1
- nothing()
- end
-
- on mouseEnter
- pDownFlag = 0
- if not draggingAnything() then
- showToolTip(pSpr, #ab)
- end if
- end
-
- on mouseLeave
- pDownFlag = 0
- if not draggingAnything() then
- hideToolTip()
- end if
- end
-
- on mouseUp me
- if pDownFlag then
- checkIfFlashWasHit(me, pSpr)
- end if
- end
-
- on goBase me
- playAnim(me, #base1, VOID, #stationary)
- end
-
- on mRecreate me, character, status, frameNum, throttleTime, animating, turnOffAnim, inRect
- global gImplementedCharacters
- pCharCode = character
- if voidp(pCharCode) then
- removeCharacterTraces(me)
- exit
- end if
- ancestor = gCharChildren[pCharCode]
- pSpr.member = me.pFlashCharMember
- updateStage()
- pSpr.member = pSpr.member
- setFlashAttributes(me)
- reg = gImplementedCharacters[pCharCode][#regPoint]
- pSpr.member.regPoint = reg
- pBigFlashRect = offset(pOrigRect, pOrigReg.locH - reg.locH, pOrigReg.locV - reg.locV)
- pFrameToRecreate = frameNum
- end
-
- on mReposition me
- if voidp(pFrameToRecreate) then
- hide(me)
- exit
- end if
- fixEventTriggers(me)
- gotoFlashFrame(pSpr, pFrameToRecreate, 1)
- end
-
- on replicate me, patronSprite
- global gImplementedCharacters
- pCharCode = patronSprite.pCharCode
- ancestor = patronSprite.scriptInstanceList[1]
- pOrigRect = patronSprite.rect
- pOrigReg = patronSprite.member.regPoint
- pSpr.member = patronSprite.pFlashCharMember
- updateStage()
- setFlashAttributes(me)
- reg = gImplementedCharacters[pCharCode][#regPoint]
- pBigFlashRect = offset(pOrigRect, pOrigReg.locH - reg.locH, pOrigReg.locV - reg.locV)
- show(me)
- fixEventTriggers(me)
- gotoFrame(pSpr, patronSprite.frame)
- end
-
- on setFlashAttributes me
- pSpr.actionsEnabled = 0
- pSpr.buttonsEnabled = 0
- pSpr.static = 1
- pSpr.originMode = #topLeft
- pSpr.clickMode = #boundingBox
- end
-
- on fixEventTriggers me
- global gLeadFrames
- show(me)
- pSpr.rect = rect(0, 0, 1, 1)
- updateStage()
- gotoFrame(pSpr, 1)
- updateStage()
- gotoFrame(pSpr, 2)
- updateStage()
- end
-
- on speak me
- dontPassEvent()
- end
-
- on newRect me
- dontPassEvent()
- end
-
- on move_glass me
- dontPassEvent()
- end
-
- on adjustFlashRect me, newSpriteRect, flashSubRect, trimLeft, trimTop
- global gShowArbusRects
- show(me)
- if gShowArbusRects then
- put "Arbus Rect" && newSpriteRect
- end if
- pSpr.rect = newSpriteRect
- centerPt = point(newSpriteRect.width / 2.0, newSpriteRect.height / 2.0)
- pSpr.viewH = flashSubRect.left + centerPt[1] + trimLeft
- pSpr.viewV = flashSubRect.top + centerPt[2] + trimTop
- end
-
- on showTree Msg
- end
-
- on soundPlaying me
- return soundBusy(pSoundChannel)
- end
-
- on setAnimationPlane me, plane
- pSpr.locZ = plane
- end
-
- on stopSound me
- sound stop pSoundChannel
- end
-
- on hide me
- pSpr.imageEnabled = 0
- pSpr.rect = rect(0, 0, 1, 1)
- end
-
- on show me
- wasEnabled = pSpr.imageEnabled
- pSpr.imageEnabled = 1
- end
-
- on characterLeft me
- global gGameTips
- stopAnimating(me)
- hide(me)
- removeCharacterTraces(me)
- end
-
- on stopAnimating me
- stopSound(me)
- end
-